package com.itheima.TSS;

import java.util.TreeSet;

/**
 * @author zhangbaiyan
 * @date 2024-09-12 09:05
 * @description:
 * @version:
 */
public class StudentTest {

    public static void main(String[] args) {

        //1.创建学生对象
        Student2 s1 = new Student2("张三", 18, 90, 80, 70);
        Student2 s2 = new Student2("李四", 19, 80, 90, 80);
        Student2 s3 = new Student2("王五", 20, 70, 80, 90);
        Student2 s4 = new Student2("赵六", 21, 60, 70, 80);
        Student2 s5 = new Student2("钱七", 22, 50, 60, 70);

        //2.创建集合对象
        TreeSet<Student2> ts = new TreeSet<>();

        //3.添加元素
        ts.add(s1);
        ts.add(s2);
        ts.add(s3);
        ts.add(s4);
        ts.add(s5);

        //打印集合
        ts.forEach(System.out::println );
    }
}
